<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Title</title>
  <style>
      .div1{
        background-color: #000000;

        width: 100px;
        height: 100px;
        /* transition: background-color 1s linear;*/
        transition-property:background-color;
        transition-duration:2s;
        transition-timing-function: linear;
        box-shadow: 10px 10px 0px gray;
      }
      .div1:hover{
        background-color: #fff;
      }


    .div2{
      background-color: red;
      width: 200px;
      height: 200px;
    }

    @-webkit-keyframes mycolor {
        0%{
          background-color: green;
        }
        40%{
          background-color: yellow;
        }
        70%{
          background-color: black;
        }
    }
    .div2:hover{
        -webkit-animation: mycolor 2s linear;
    }
  </style>
</head>
<body>
<div class="div1"></div>
<div class="div2"></div>
</body>
</html>
